clear all;

load('baseline.mat','prod_baseline');
load('credit.mat','prod_psi');
load('deposit.mat','prod_zeta');
load('noexp.mat','prod_no_reform');
load('credittobaseline.mat')
load('noreformtodeposit.mat');

year1=86:1:96;
year2=87:1:96;
fig=figure('color', [1 1 1 ], 'Position',[200 20 800 740]);
subplot(2,2,1)
plot(year1,prod_zeta(1:11),'-b','linewidth',2);
hold on
plot(year1,prod_no_reform(1:11),'--k','linewidth',2);
title( 'A. Average talent weighted by output', 'FontSize',15,'Interpreter','Latex');
xlabel('year', 'FontSize',12,'Interpreter','Latex');
ylabel('average talent weighted by output', 'FontSize',12,'Interpreter','Latex');
legend('deposit channel','no bank expansion','interpreter','latex','location','northwest')
ylim([1.82,1.885]);
yticks(1.82:0.02:1.88)
xlim([86,96]);
set(gca,'FontSize',12);


subplot(2,2,2)
plot(year1,prod_baseline(1:11),'-b','linewidth',2);
hold on
plot(year1,prod_psi(1:11),'--k','linewidth',2);
title( 'B. Average talent weighted by output', 'FontSize',15,'Interpreter','Latex');
xlabel('year', 'FontSize',12,'Interpreter','Latex');
ylabel('average talent weighted by output', 'FontSize',12,'Interpreter','Latex');
legend('baseline','credit channel','interpreter','latex','location','southwest')
ylim([1.82,1.885])
yticks(1.82:0.02:1.88)
xlim([86,96]);
set(gca,'FontSize',12);

subplot(2,2,3)
plot(year2,zeta_pct_of_unbanked,'-b','linewidth',2);
hold on
plot(year2,psi_pct_of_unbanked,'--k','linewidth',2);
title( [{'C. Frac. of additional funds flowing into'}, {'markets without branches in 1986'}], 'FontSize',15,'Interpreter','Latex');
xlabel('year', 'FontSize',12,'Interpreter','Latex');
ylabel('frac. in markets without branches', 'FontSize',12,'Interpreter','Latex');
legend('no bank expansion $\rightarrow$ deposit','credit $\rightarrow$ baseline','interpreter','latex','location',[0.298 0.398 0 0]);
ylim([0,1]);
xlim([87,96]);
set(gca,'FontSize',12);


subplot(2,2,4)
plot(year2,zeta_pct_of_banked,'-b','linewidth',2);
hold on
plot(year2,psi_pct_of_banked,'--k','linewidth',2);
title( [{'D. Frac. of additional funds flowing into'}, {'markets with branches in 1986'}], 'FontSize',15,'Interpreter','Latex');
xlabel('year', 'FontSize',12,'Interpreter','Latex');
ylabel('frac. in markets with branches', 'FontSize',12,'Interpreter','Latex');
legend('no bank expansion $\rightarrow$ deposit','credit $\rightarrow$ baseline','interpreter','latex','location',[0.738 0.15 0 0]);
ylim([0,1]);
xlim([87,96]);
set(gca,'FontSize',12);
